<!doctype html>
        <!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en-US"> <![endif]-->
        <!--[if IE 7]>    <html class="lt-ie9 lt-ie8" lang="en-US"> <![endif]-->
        <!--[if IE 8]>    <html class="lt-ie9" lang="en-US"> <![endif]-->
        <!--[if gt IE 8]><!--> <html lang="en-US"> <!--<![endif]-->
        <head>
                <!-- META TAGS -->
                <meta charset="UTF-8" />
                <meta name="viewport" content="width=device-width, initial-scale=1.0">

                <title>Knowledge Base Theme</title>

                <link rel="shortcut icon" href="images/favicon.png" />


                

                <!-- Style Sheet-->
                <link rel="stylesheet" href="style.css"/>
                <link rel='stylesheet' id='bootstrap-css-css'  href='css/bootstrap5152.css?ver=1.0' type='text/css' media='all' />
                <link rel='stylesheet' id='responsive-css-css'  href='css/responsive5152.css?ver=1.0' type='text/css' media='all' />
                <link rel='stylesheet' id='pretty-photo-css-css'  href='js/prettyphoto/prettyPhotoaeb9.css?ver=3.1.4' type='text/css' media='all' />
                <link rel='stylesheet' id='mhain-css-css'  href='css/main5152.css?ver=1.0' type='text/css' media='all' />
                <link rel='stylesheet' id='custom-css-css'  href='css/custom5152.html?ver=1.0' type='text/css' media='all' />
				<link rel='stylesheet' href="css/no-show.css" />
                <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
                <!--[if lt IE 9]>
                <script src="js/html5.js"></script></script>
                <![endif]-->

        </head>

        <body>
<div id="app" v-cloak>

    <div class="header-wrapper">

            <div class="container">


                <div >
                    <!-- Website Logo -->
                    <a href="main.html"   >
                        <img src="images/taru.jpg"
                             style="height:60px;">
                    </a>
                    <span class="tag-line">塔里木大学</span>
                </div>


                <!-- Start of Main Navigation -->
                <nav class="main-nav">
                    <div class="menu-top-menu-container">
                        <ul id="menu-top-menu" class="clearfix">
                            <li class="current-menu-item"><a href="main.html">Home</a></li>
                            <li><a href="#">科普模块</a>
                                <ul class="sub-menu">
                                    <li><a @click="pes"  href="disease-list.html">虫害科普</a></li>
                                    <li><a @click="pesCon" href="disease-list.html">虫害防治</a></li>
                                    <li><a @click="dis" href="disease-list.html">病害科普</a></li>
                                    <li><a @click="disCon" href="disease-list.html">病害防治</a></li>
                                </ul></li>
                            <li><a href="exchange-list.html">讨论模块</a></li>
                            <li><a href="forecast.html">数据预测</a></li>
                            <li><a href="#">用户信息</a>
                                <ul class="sub-menu">
                                    <li><a href="selectUser.html">查看用户信息</a></li>
                                    <li><a href="updateUser.html">修改用户信息</a></li>
                                    <li><a href="updateUserPassword.html">修改用户密码</a></li>
                                </ul>
                            </li>
                            <li v-if="flag"><a href="#">管理员模块</a>
                                <ul class="sub-menu">
                                    <li><a href="disease-list-statue.html">文章审核</a></li>

                                </ul>
                            </li>

                        </ul>
                    </div>
                </nav>
                <!-- End of Main Navigation -->

            </div>

    </div>

             

                <!-- Start of Page Container -->
                <div class="page-container">
                        <div class="container">
                                <div class="row">
									
                                        <!-- start of page content -->
                                        <div class="span8 page-content" >

                                                <article class=" type-post format-standard hentry clearfix" >
													
														<h1 class="post-title">{{exchangeTitle}}</h1>
														<pre>
															<p>{{exchangeDetailes}}</p>
                                                             <img :src="imgSrc" style="width: 200px; height: 200px">
														</pre>
														<div>
                                                             <input v-model="detail" placeholder="想对作者说些什么" class="span4" type="text" style="width: 600px; height: 40px;" value="" size="50" >
                                   							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                             <input @click="sub" class="btn" name="submit" type="submit" id="submit"  value="Submit Comment" style=" height: 50px;">
                                                                        
                                                        </div>
														<span style="font-size:20px;"> 共{{len}}条评论 </span>
														<hr style=" height:2px;border:none;border-top:2px dotted #185598;" />
													<div v-for="userMessage in list" >
														<img class="normal"></img>	<a style="font-size:30px; "> &nbsp;&nbsp;&nbsp;&nbsp;  {{userMessage.user.userName}}</a>
														<br />
															<br />
																<p>{{userMessage.commentDetailes}}</p>
															
													</div>
														
                                                        

                                              

                                        </div>
                                        <!-- end of page content -->


                                        <!-- start of sidebar -->
                                        <aside class="span4 page-sidebar">

                                                <section class="widget">
                                                        <div class="support-widget">
                                                            <h3  class="title"><span v-model="userNickname" ><input style="border:none; background-color:transparent;"  readonly="readonly" v-model="userNickname"></span></h3>
                                                            <p class="intro"><div  v-model="userNickname" > 亲爱的用户欢迎您</div></p>
                                                        </div>
                                                </section>
                                            <button @click="insert" type="submit" class="btn btn-lg btn-danger lt b-white b-2x btn-block" id="validate-submit">
                                                <i  class="icon-arrow-right pull-right"></i><span class="m-r-n-lg">发帖</span></button>
                                            <div v-if="flag">
                                                <br>
                                                <button @click="insert" type="submit" class="btn btn-lg btn-danger lt b-white b-2x btn-block" id="validate-submit">
                                                    <i  class="icon-arrow-right pull-right"></i><span class="m-r-n-lg">审核通过</span></button>
                                            </div>
                                            <div v-if="flag">
                                                <br>
                                                <button @click="insert" type="submit" class="btn btn-lg btn-danger lt b-white b-2x btn-block" id="validate-submit">
                                                    <i  class="icon-arrow-right pull-right"></i><span class="m-r-n-lg">审核不通过</span></button>
                                            </div>

                                                <section class="widget">
                                                        <h3 class="title">往期文章</h3>
                                                        <ul class="articles">
                                                                <li class="article-entry standard">
                                                                        <h4><a href="single.html">枣树病虫害防治技术要点</a></h4>
                                                                </li>
                                                                <li class="article-entry standard">
                                                                        <h4><a href="single.html">枣树病虫害防治：枣树的常见病虫害及防治方法简介</a></h4>
                                                                </li>
                                                                <li class="article-entry video">
                                                                        <h4><a href="single.html">粘虫板在枣树虫害防治中的应用研究</a></h4>
                                                                </li>
                                                                <li class="article-entry image">
                                                                        <h4><a href="single.html">枣树种植技术及管理方法</a></h4>
                                                                </li>
                                                        </ul>
                                                </section>

                                        </aside>
                                        <!-- end of sidebar -->
                                </div>
                        </div>
                </div>
                <!-- End of Page Container -->

               
</div>
                <a href="#top" id="scroll-top"></a>

                <!-- script -->
                <script type='text/javascript' src='js/jquery-1.8.3.min.js'></script>
                <script type='text/javascript' src='js/jquery.easing.1.3.js'></script>
                <script type='text/javascript' src='js/prettyphoto/jquery.prettyPhoto.js'></script>
                <script type='text/javascript' src='js/jflickrfeed.js'></script>
                <script type='text/javascript' src='js/jquery.liveSearch.js'></script>
                <script type='text/javascript' src='js/jquery.form.js'></script>
                <script type='text/javascript' src='js/jquery.validate.min.js'></script>
                <script type='text/javascript' src='js/custom.js'></script>
                <script type="text/javascript" src="js/url.js"></script>
				<script type="text/javascript" src="js/vue(1).js"></script>
				<script type="text/javascript" src="js/axios.min.js"></script>
				
				<script>
					var vue = new Vue({
						el: '#app', //挂载点
						data: {
							list:[],
							articleId:'',
							exchangeDetailes:'',
							exchangeTitle:'',
							commentDetailes:'',
							len:'',
							detail:'',
                            flag:false,
							userId:'',
                            imgSrc:''
						},
						created: function() {
							this.init();
                            this.userOrAdmin();
                            this.selectPho();
						},
						methods: {
                            userOrAdmin: function(){
                                var self = this;
                                var userSort = window.sessionStorage.getItem("userSort");
                                console.log(userSort)
                                if(userSort == 2 ){
                                    self.flag = true;
                                }
                            },
							init: function(){
								
							var self = this;
							self.articleId = window.sessionStorage.getItem("articleId");
                                self.userNickname = window.sessionStorage.getItem("userNickname");
							var param=new URLSearchParams();	
							param.append('exchangeId',self.articleId);
								axios
								.post(web_server+"query/exchange/id",param)
									.then(function(response) {
										var objects= response.data;
										
										if(objects.status == 200) {
											
											var object = objects.data
											self.exchangeTitle = object.exchangeTitle;
											self.exchangeDetailes = object.exchangeDetailes;
												 self.comm();
										}
									})
								.catch(function(error) {
									
									alert(error)
								});
							},
							comm: function(){
							var self = this;
							var params=new URLSearchParams();	
							params.append('articleId',self.articleId);
								axios
								.post(web_server+"query/comment/details",params)
									.then(function(response) {
										//var object =JSON.stringify(response)
										var objects= response.data;
										if(objects.status == 200) {
											var object = objects.data
											self.commentDetailes = object.commentDetailes;
											self.list = object;
											self.len = object.length;
										}
									
									})
								.catch(function(error) {
									alert(error)
									
								});
							},

                        selectPho: function(){
                            var self = this;
                            var params=new URLSearchParams();
                            params.append('articleId',self.articleId);
                            axios
                                .post(web_server+"query/photo/articleId",params)
                                .then(function(response) {
                                    var objects= response.data;
                                    if(objects.status == 200) {
                                        var object = objects.data
                                        console.log(object)
                                        self.imgSrc = object.photoOne;

                                    }

                                })
                                .catch(function(error) {
                                    alert(error)

                                });
                        },
							sub: function(){
							var self = this;
							var comDet = self.detail;
							if(comDet.length==0){
								alert("评论内容不能为空");
							}
							self.userId = window.sessionStorage.getItem("userId");
							var params=new URLSearchParams();	
							params.append('articleId',self.articleId);
							params.append('commentDetailes',comDet);
							params.append('userId',self.userId);
								axios
								.post(web_server+"insert/comment",params)
									.then(function(response) {
										//var object =JSON.stringify(response)
										var objects= response.data;
										if(objects.status == 200) {
											var object = objects.data
										}
									})
								.catch(function(error) {
									alert(error)
								});
							},
                         insert: function(){
                            window.location.href = "red-skin.html";
                        },
                            pes:function(){
                                window.sessionStorage.setItem("sort", "1");
                            },
                            pesCon:function(){
                                window.sessionStorage.setItem("sort", "2");
                            },
                            dis:function(){
                                window.sessionStorage.setItem("sort", "3");
                            },
                            disCon:function(){
                                window.sessionStorage.setItem("sort", "4");
                            }
						}
					})
				</script>

        </body>
</html>
